package com.stefanini.pe.bbva.bp.in.controller;

import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ComponentSystemEvent;

import org.springframework.stereotype.Controller;

import com.stefanini.pe.bbva.bp.in.security.AuthorizationService;
import com.stefanini.pe.bbva.bp.in.utils.SpringApplicationContext;

@Controller(value = "principalController")
@RequestScoped
public class PrincipalController {
	
	public void onPageLoad(ComponentSystemEvent event) {
		AuthorizationService auth = (AuthorizationService)SpringApplicationContext.getBean("authorizationService");
		if (auth.isSessionUserAndContextValide() && !FacesContext.getCurrentInstance().isPostback()) {
			System.out.println("PrincipalController... is not Postback");
		}
	}
}
